﻿using System.Diagnostics;

namespace MutsiEngine
{
    public class GameTime
    {
        public Stopwatch TotalTime = new Stopwatch();
        public Stopwatch DeltaTime = new Stopwatch();

        public string ElapsedTimeString{
            get{return string.Format("{0:00}:{1:00}:{2:00}.{3:00}", TotalTime.Elapsed.Hours, TotalTime.Elapsed.Minutes, TotalTime.Elapsed.Seconds, TotalTime.Elapsed.Milliseconds / 10);}
        }

        public GameTime()
        {
            TotalTime.Start();
            DeltaTime.Start();
        }

        public void Update()
        {
            DeltaTime.Stop();
            DeltaTime.Reset();
            DeltaTime.Start();
        }
    }
}
